﻿using msBsc.AppLogic.DataAlc;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace msBsc.WebUi.mMall.Seller
{
    public partial class mfAgentDjackOrderList : msBsc.Cls.mBPProxyDealer
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private void getOrderList()
        {
            string userId = msBsc.SvRef.UserInfo.Operator;
            if (string.IsNullOrEmpty(userId))
            {
                return;
            }

            string orderStatus = this.GetParamHtValue("orderStatus");
            using (msBsc.AppLogic.DataAlc.CBizDiversionOrder orderInfo = new AppLogic.DataAlc.CBizDiversionOrder())
            {
                int oStatus = 0;
                int.TryParse(orderStatus, out oStatus);

                DataSet ds = orderInfo.GetDjackOrderByCondition("", orderStatus, "", "");
                if (ds == null || ds.Tables[0].Rows.Count < 1)
                {
                    this.ExecJScript(@"alert(""您没有该类型订单"");$(""#order_list"").html("""");");
                    return;
                }
                string ret = msBsc.AppLogic.Cfg.HttpTools.GetJsonByTable(ds.Tables[0], "", "", 1, 1000, "");
                this.ExecJScript("setOrderList(" + ret + ")");
            }
        }


        public override void DoAction()
        {
            if (this.strAction == "getOrderList")
            {
                getOrderList();
            }
        }
    }
}